import React from 'react';
import {Form, Input} from 'antd'
/*
添加列表的form组件
 */
const EditForm =(props)=>{
    console.log(props,'params');
    const onValuesChange =(value)=>{
        value._id=props.category._id
        //将form对象通过setForm
        props.setForm(value)
    }


    return (
        <div>
            <Form
                name="basic"
                initialValues={{remember: true,}}
                autoComplete="off"
                onValuesChange={onValuesChange}
            >
                <Form.Item
                    label="分类名称"
                    name="parentTitle"
                >
                    <Input placeholder="请输入分类名称" defaultValue={props.category.title||''}/>
                </Form.Item>
            </Form>
        </div>
    );
}

export default EditForm;